package io.gitee.wminyu.day06;

import org.junit.Test;

import java.util.*;

public class Search_DNA {
//    public static void main(String[] args) {
//        Scanner input = new Scanner(System.in);
//        int  Nucleotide = input.nextInt();
//        System.out.println(Nucleotide);
//    }

    @Test
    public void test(){

        String s =  "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT";
        Set<String>set1 = new HashSet<>();
        Set<String>set2 = new HashSet<>();
       for (int i = 0;i<s.length()-9;i++){
           String part = s.substring(i,i+10);
           if (set1.contains(part)){
               set1.add(part);
               set2.add(part);
           }else {
               set1.add(part);
           }
       }
        Iterator<String>iterator= set2.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
//       System.out.println(set2);


    }

}